Page({
  data: {
    currentTab: 0,
    categories: [
      { id: 1, name: '全部' },
      { id: 2, name: '家政' },
      { id: 3, name: '医疗' },
      { id: 4, name: '护理' }
    ],
    serviceList: [
      { id: 1, title: '家庭保洁', desc: '专业团队上门服务', price: '80', rating: '4.8', image: 'https://dummyimage.com/600x400/eeeeee/aaaaaa.png&text=service' },
      { id: 2, title: '健康体检', desc: '全面体检套餐', price: '300', rating: '4.9', image: 'https://dummyimage.com/600x400/eeeeee/aaaaaa.png&text=service' },
      { id: 3, title: '康复护理', desc: '专业康复师指导', price: '150', rating: '4.7', image: 'https://dummyimage.com/600x400/eeeeee/aaaaaa.png&text=service' }
    ]
  },

  onTabChange(e) {
    const index = e.currentTarget.dataset.index;
    this.setData({ currentTab: index });
  },

  onServiceTap(e) {
    const id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: `/pages/service/booking/booking?id=${id}`
    });
  }
})
